define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {

		/**
		 * 一键切换数据获取方式
		 * @param {Object} result
		 */
		function get_data_getresult(result) {
			if(!false) {
				result = '{"success":true,"msg":"","result":{"act_id":"001","apply_count":1000,"prize_count":1000,"member":[{"member_id":"001","name":"张三","region":"江苏","is_prize":true,"pay_status":"已支付"},{"member_id":"002","name":"张三","region":"江苏","is_prize":true,"pay_status":"已支付"}],"choose_count":100,"pay_count":90},"session":"7311da98bd0f18eb15a96bcb263f4153"}';
				return JSON.parse(result);
			} else {
				return result;
			}
		}

		//返回信息
		return {
			//轮播图 固定的不需要界面传参数
			getresult: function(act_id, callback) {
				Http.post({
						method: 'marketing.goodstest.result',
						act_id: act_id
					},
					function(result) {
						//请求成功
						if(callback)
							callback(get_data_getresult(result).result);
					},
					function(e) {
						//请求异常
					},
					function() {
						//请求完成，一般不做什么事情
					}
				);
			}
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Luckydrawdetail", factory);
});